let minRed = document.querySelector(".min-red ")
let redRode = document.querySelector(".red-road")
let vBox = document.querySelector(".vo-road")
let crvol = document.querySelector('.cr_vol')
let maxVoice = document.querySelector('.ctr-voice')


vBox.addEventListener("click", function (event) {
  let Y = event.offsetY;//获取鼠标所在位置
  let bfb = 93 - Y
  if (Y >= 93) { bfb = 93 }
  if (Y <= 0) { bfb = 0 }
  redRode.style.height = bfb + "px";
  myaudio.volume = bfb / 100;
  console.log(myaudio.volume);
});

redRode.addEventListener("click", function (event) {
  let Y = event.offsetY;//获取鼠标所在位置
  let bfb = 93 - Y;
  if (Y >= 93) { bfb = 93 }
  if (Y <= 0) { bfb = 0 }
  redRode.style.height = bfb + "px";
  console.log(redRode.style.height);
  myaudio.volume = bfb / 100;
});


let num1 = 1
crvol.addEventListener("click", function () {
  if (num1 === 1) {
    maxVoice.style.visibility = 'visible'
    num1 = num1 * -1
  } else {
    maxVoice.style.visibility = 'hidden'
    num1 = num1 * -1
  }
})

// redRode.onclick = function(){
//   console.log(999);
// }















// let myaudio = document.querySelector('#myaudio')


// vBox.addEventListener('click', function (e) {
//   let et = e.target
//   if (e.target.className === "min-red") {
//      let T = 81 - et.offsetTop
//      myaudio.volume=T/100;
//   }
//   if (e.target.className === ".vo-road") {
//     let Y = e.offsetY
//     let bfb = Y / 93 * 100;
//     redRode.style.height = bfb + "px";
//     myaudio.volume=T/100;
//   }
// })

// redRode.addEventListener("click", function (event) {
//   let Y = event.offsetY;//获取鼠标所在位置
//   let bfb = 93 - Y;
//   redRate.style.height = bfb + "px";
//   myaudio.volume = bfb / 100;
// });
